import java.io.BufferedReader;
	import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.concurrent.Semaphore;


	public class ZipThread extends Thread {
		TestZip zip;
		Semaphore a,b,c; 
		public ZipThread(TestZip zip2,Semaphore a1,Semaphore a2,Semaphore a3){
			 zip=zip2;
			 a=a1;b=a2;c=a3;
			
		}
		public void run(){
           try{
				 
				 a.acquire();
				 c.acquire();
				}catch(InterruptedException e){}
			 try{
					
				 Thread.sleep(500);
				}
				catch(InterruptedException e){
					 
				}
			
				 readTex("link.txt");
			 
				
				  
				 b.release();
				 
			
		}
		public void readTex(String v) {
			
			String lineContent = null;
			
		    try {
		      
		      InputStream is = getClass().getResourceAsStream(v);
		      BufferedReader br = new BufferedReader
		      
		         (new InputStreamReader(is));
		      while ((lineContent = br.readLine()) != null) {
					
	               zip.unzip(lineContent+".zip","");
	               
		         }
		      zip.unzip("hsci_p1NO_MBRS.zip","");
		      zip.unzip("hsci_p2.zip","");
		   
		      }
		    catch (Exception e) {
		      e.printStackTrace();
		      }
			
		  }
		
			
		}


